/**
 * 
 */
package graphicView;

import java.awt.Graphics;
import java.awt.Polygon;
import java.awt.Shape;
import java.awt.geom.GeneralPath;

import model.RelationshipImpl;

/**
 * @author Team EBE
 *
 */
public class CompositionGraphicObject extends RelationshipGraphicObject {

	//protected RelationshipImpl compositionObject;
	//protected boolean active = false;
	
	/**
	 * @param relationshipObjectIn
	 */
	public CompositionGraphicObject(RelationshipImpl relationshipObjectIn) {
		super(relationshipObjectIn);
		// TODO Auto-generated constructor stub
	}

	public void activate() {
		active = true;
	}

	public void deactivate() {
		active = false;
	}

	public boolean isActive() {
		return active;
	}

	public void sendToInspector() {
		System.out.println("black");
		setChanged();
		notifyObservers(this.relationshipObject);
	}
	
	@Override
	public void drawRelationship(Graphics g) {
		
		float s = 0;	
		g.drawLine(relationshipObject.getSrc().x, relationshipObject.getSrc().y, relationshipObject.getDest().x, relationshipObject.getDest().y);
		
	      
	}
	
	
	
	//code derived from example on www.coderanch.com
	public static Shape makeADiamond(float s){
		
		final GeneralPath gp = new GeneralPath();
	      gp.moveTo(0.0f, -s);
	      gp.lineTo(s, 0.0f);
	      gp.lineTo(0.0f, s);
	      gp.lineTo(-s, 0.0f);
	      gp.closePath();
	      
	      return gp;
				
	}
	
	//Keep in mind..... Calculation of Points on each side.....
	
	
}
